package com.sumainfor.pc.market.controller.epc;

import com.sumainfor.common.util.FieldCheckUtil;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.TenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 功能描述:
 *
 * @Auther: zhlu
 * @Date: 2019/5/10 13:43
 * @Description:
 */
@RestController
@RequestMapping("/key/tenant")
public class TenantController {

    @Autowired
    TenantService TenantService;

    /**
     * 功能描述: 
     * 根据租客编号获取租客资料
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/5/10 13:45
     */
    @GetMapping("/getTenantMap")
    public JsonResult getTenantMap(@RequestParam Map<String,Object> params){
        JsonResult result=new JsonResult();
        if(!FieldCheckUtil.isMapFieldNotNull(params,new String[]{"TenId"})){
            result.putFailed("TenId不能为空！");
            return  result;
        }
        result.put(TenantService.getTenantMap(params));
        return result;

    }

}
